home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
UTILITY1
/
MSWLGO35.ZIP
/
EXAMPLES
/
VISUAL.WIN
< prev
Wrap
Text File
|
1993-08-23
|
26KB
|
907 lines
;
; Function:
;
; This function is a simple DialogBox editor. It is still incomplete
; but is usable. In fact I wrote part of this application with itself !!!
;
; To run:
;
; Load "visual.win
; Call visual
; <click on load button>
; <enter "boxes">
;
; To move a control, click down with mouse in the upper left corner inside
; the box and drag it. Then let mouse button go.
;
; To resize a control, click down with mouse in the lower right corner inside
; the box and drag it. Then let mouse button go.
;
; To change parameters on a box or delete it click in the middle of the control
;
; To see what the dialog really looks like click on the Test Button.
; Click EndTest button to close it.
;
; To snap each control to a grid in the snap to grid button and enter
; grid size.
;
; To save the changes click on save (note testing does a save).
;
; If dragging is to slow hot fast drag
;
; To add a control hit one of the "NEW-" bottons. The control will be
; placed in the upper left corner outside of the dialog box.
;
; To select the DIalog box itself for resizing, click
; anywhere inside the dialog box but not on a control.
;
; It does not know about the code that actaully makes the dialog
; box/window itself, just the control in one.
;
; It does not know about ANY other code except "SOMETHINGcreate".
;
; If you put all your code that "CREATE"s controls in one procedure,
; it's almost usable. I used it for all the dialogs in this application
; and found an improment over calculating coordinates.
;
; If also expects ALL text arguments to be LISTs (even though
; words are legal).
;
; Some day I hope to finish this and perhaps add hooks (or rewrite in C)
; to MswLogo so that REAL buttons can be dragged FAST.
;
to boxes
groupboxcreate "main [group1] 20 50 70 50
radiobuttoncreate "main [group1] [Radio1] [Radio Button] 30 60 50 10
checkboxcreate "main [group1] [check1] [Check Box] 30 80 50 10
scrollbarcreate "main [Scroll1] 20 30 70 10 [Print "Scrolled]
buttoncreate "main [Button1] [Button to be Push] 20 10 50 10 [Print "Push]
comboboxcreate "main [combo1] 20 110 50 30
listboxcreate "main [list1] 20 150 70 20
staticcreate "main [static1] [This is a static box] 20 180 140 10
end
to deletething
unselectbox :select
setpensize [2 2]
drawbox_detail last :select first :select
make "select []
end
to doclose2
ifelse equalp first :select "buttoncreate~
[~
make "the_last last :select~
make "the_title comboboxgettext "cb22~
make "the_cb comboboxgettext "cb21~
make "the_name comboboxgettext "cb23~
make "select butlast butlast butlast butlast :select~
make "select lput :the_name :select~
make "select lput :the_title :select~
make "select lput :the_cb :select~
make "select lput :the_last :select~
]~
[~
ifelse equalp first :select "scrollbarcreate~
[~
make "the_cb comboboxgettext "cb21~
make "the_last last :select~
make "the_name comboboxgettext "cb23~
make "select butlast butlast butlast :select~
make "select lput :the_name :select~
make "select lput :the_cb :select~
make "select lput :the_last :select~
]~
[~
ifelse equalp :kind "staticcreate~
[~
make "the_title comboboxgettext "cb22~
make "the_last last :select~
make "the_name comboboxgettext "cb23~
make "select butlast butlast butlast :select~
make "select lput :the_name :select~
make "select lput :the_title :select~
make "select lput :the_last :select~
]~
[~
ifelse (or equalp :kind "radiobuttoncreate~
equalp :kind "checkboxcreate)~
[~
make "the_title comboboxgettext "cb22~
make "the_last last :select~
make "the_name comboboxgettext "cb23~
make "the_group comboboxgettext "cb24~
make "select butlast butlast butlast butlast :select~
make "select lput :the_group :select~
make "select lput :the_name :select~
make "select lput :the_title :select~
make "select lput :the_last :select~
]~
[~
make "the_last last :select~
make "the_name comboboxgettext "cb23~
make "select butlast butlast :select~
make "select lput :the_name :select~
make "select lput :the_last :select~
]~
]~
]~
]
dialogdelete "dlg2
end
to doclose3
make "main_x first comboboxgettext "cb31
make "main_y first comboboxgettext "cb32
dialogdelete "dlg3
vrefresh
end
to doinit2
make "kind first :select
ifelse equalp :kind "buttoncreate~
[~
make "the_cb last butlast :select~
make "the_title last butlast butlast :select~
make "the_name last butlast butlast butlast :select~
make "the_group "N/A~
comboboxsettext "cb24 :the_group~
comboboxsettext "cb23 :the_name~
comboboxsettext "cb22 :the_title~
comboboxsettext "cb21 :the_cb~
]~
[~
ifelse equalp :kind "scrollbarcreate~
[~
make "the_cb last butlast :select~
make "the_name last butlast butlast :select~
make "the_title "N/A~
make "the_group "N/A~
comboboxsettext "cb24 :the_group~
comboboxsettext "cb23 :the_name~
comboboxsettext "cb22 :the_title~
comboboxsettext "cb21 :the_cb~
]~
[~
ifelse equalp :kind "staticcreate~
[~
make "the_cb "N/A~
make "the_title last butlast :select~
make "the_name last butlast butlast :select~
make "the_group "N/A~
comboboxsettext "cb24 :the_group~
comboboxsettext "cb23 :the_name~
comboboxsettext "cb22 :the_title~
comboboxsettext "cb21 :the_cb~
]~
[~
ifelse (or equalp :kind "radiobuttoncreate~
equalp :kind "checkboxcreate)~
[~
make "the_cb "N/A~
make "the_title last butlast :select~
make "the_name last butlast butlast :select~
make "the_group last butlast butlast butlast :select~
comboboxsettext "cb24 :the_group~
comboboxsettext "cb23 :the_name~
comboboxsettext "cb22 :the_title~
comboboxsettext "cb21 :the_cb~
]~
[~
make "the_cb "N/A~
make "the_title "N/A~
make "the_name last butlast :select~
make "the_group "N/A~
comboboxsettext "cb24 :the_group~
comboboxsettext "cb23 :the_name~
comboboxsettext "cb22 :the_title~
comboboxsettext "cb21 :the_cb~
]~
]~
]~
]
end
to doinit3
comboboxsettext "cb31 :main_x
comboboxsettext "cb32 :main_y
end
to dosetup
buttoncreate "dlg "New5 "New-ComboBox 15 85 55 15 [newbutton "comboboxcreate]
buttoncreate "dlg "Save "Save 85 95 50 15 [vsave]
buttoncreate "dlg "New2 "New-ScrollBar 15 25 55 15 [newbutton "scrollbarcreate]
buttoncreate "dlg "Load "Load 140 95 45 15 [vload first readlist]
buttoncreate "dlg "Fast "Fast-Drag 140 115 45 15 [Make "slowmode "false]
buttoncreate "dlg "Snap "Snap 105 15 65 15 [snapboxes]
buttoncreate "dlg "New1 "New-Button 15 5 55 15 [newbutton "buttoncreate]
buttoncreate "dlg "Slow "Slow-Drag 85 115 50 15 [Make "slowmode "true]
buttoncreate "dlg "New9 "New-CheckBox 15 145 55 15 [newbutton "checkboxcreate]
buttoncreate "dlg "Test "Test 85 75 50 15 [mytest]
buttoncreate "dlg "end "End 80 165 50 15 [visualend]
buttoncreate "dlg "Refresh "Refresh 105 35 65 15 [vrefresh]
buttoncreate "dlg "End [End Test] 140 75 45 15 [myendtest]
buttoncreate "dlg "New4 "New-RadioBtn 15 125 55 15 [newbutton "radiobuttoncreate]
buttoncreate "dlg "New3 "New-GroupBox 15 105 55 15 [newbutton "groupboxcreate]
buttoncreate "dlg "New8 "New-StaticBox 15 45 55 15 [newbutton "staticcreate]
buttoncreate "dlg "New7 "New-ListBox 15 65 55 15 [newbutton "listboxcreate]
end
to dosetup2
comboboxcreate "dlg2 "cb21 60 12 60 12
comboboxcreate "dlg2 "cb22 60 36 60 12
staticcreate "dlg2 "st22 [Title] 12 36 36 12
staticcreate "dlg2 "st21 [Callback] 12 12 36 12
staticcreate "dlg2 "st23 [Name] 12 60 36 12
buttoncreate "dlg2 "dlg2_OK [OK] 12 132 48 12 [doclose2]
buttoncreate "dlg2 "btn23 [Cancel] 72 132 48 12 [dialogdelet